﻿@model IEnumerable<TicketingCompany.Models.Event>

@{
    ViewBag.Title = "All Events";
}

<h2>All</h2>

<p>
    @Html.ActionLink("View By Category", "../Category/SelectCategory")
</p>
<table>
    <tr>
        <th>
            Title
        </th>
        <th>
            Category
        </th>
        <th>
            Location
        </th>
        <th>
            DateTime
        </th>
        <th>
            Price
        </th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @item.Title
        </td>
        <td>
            @item.Category.Name
        </td>
        <td>
            @item.Location.Name
        </td>
        <td>
            @String.Format("{0:g}", item.DateTime)
        </td>
        <td>
            @String.Format("{0:F}", item.Price)
        </td>
    </tr>
}

</table>

